<?php
require_once 'PHPUnit/Framework.php';
require_once 'TVB/pms/pdes/common/bootstrap.php';
require_once 'TVB/pms/pdes/common/util/MisApi.class.php'; 
require_once 'TVB/pms/pdes/common/util/MisApiConfig.php'; 

require_once 'TVB/pms/pdes/common/util/mis/MisProgramme.class.php';
require_once 'TVB/pms/pdes/common/util/mis/MisCastHelper.class.php';
require_once 'TVB/pms/pdes/common/util/mis/MisMapping.class.php';

class MisProgrammeTest extends PHPUnit_Framework_TestCase
{
    public $programme;

    function setUp()
    {
        $this->programme = new MisProgramme;
    }

    function tearDown()
    {
        unset($this->programme);
    }

    function testExistsRelation()
    {   
        $programmes = array(
            array(
                'PGM_ID'   => '015401240'
            ),
        );

        $ret = $this->programme->import($programmes);
		$this->assertEquals($ret, TRUE); 	
    }

    function testNotExistsRelation()
    {
        $programmes = array(
            array(
                'PGM_ID'    => '015401240'
            ),
            array(
                'PGM_ID'    => '015401240'
            ),
        );
        $ret = $this->programme->import($programmes);
		$this->assertEquals($ret, TRUE); 	
    }
}
?>
